package com.ssyt.yt1.day9;

/**
 * 测试属性可以被重写？
 * 
 * @author Administrator
 *
 */
class A {

	public int version = 1;

	public void printVersion() {
		System.out.println("A.printVersion()...");
	}
}

class B extends A {

	// 属性没有重写的概念！
	public int version = 2;

	@Override
	public void printVersion() {
		System.out.println("B.printVersion()...");
	}
}

public class OverrideTest {

	public static void main(String[] args) {
		A a = new B();
		a.printVersion();
		System.out.println(a.version);
	}
}
